import Opt from '@/components/dt/info/Opt.js'

class Column extends Opt {
  constructor() {
    super()
    this.build()
  }

  build() {
    this.createAll()
    this.opts.push(...this.all)
  }

  createAll() {
    this.all = [
      {
        field: 'orgName',
        title: '所属组织',
        minWidth: 160
      },
      {
        field: 'buildingName',
        title: '案场名称',
        minWidth: 180
      },
      {
        field: 'buildingStatus',
        title: '案场状态',
        minWidth: 160,
        header: {
          filter: {
            title: '案场状态',
            placeholder: '全部',
            key: 'buildingStatus',
            select: {
              key: 'buildStatus',
              multiple: true
            }
          }
        },
        cell: {
          text: {
            type: 'dict',
            key: 'buildStatus'
          }
        }
      },
      {
        field: 'approachTime',
        title: '项目进场时间',
        minWidth: 140
      },
      {
        field: 'withdrawalTime',
        title: '项目撤场时间',
        minWidth: 130
      },
      {
        field: 'isFiling',
        title: '是否归档完毕',
        minWidth: 160,
        header: {
          filter: {
            title: '是否归档完毕',
            placeholder: '全部',
            key: 'isFiling',
            select: {
              options: [
                { key: '0', value: '未归档' },
                { key: '1', value: '归档' }
              ]
            }
          }
        },
        cell: {
          value: (row) => (row.isFiling == 1 ? '归档' : '未归档'),
          text: {}
        }
      },
      {
        field: 'contractAgreement',
        title: '合同及补充协议',
        minWidth: 180
      },
      {
        field: 'contractAgreementManager',
        title: '存档管理人',
        minWidth: 160
      },
      {
        field: 'housesData3',
        title: '往来函件',
        minWidth: 160
      },
      {
        field: 'housesData3Manager',
        title: '存档管理人',
        minWidth: 160
      },
      {
        field: 'housesData2',
        title: '销讲',
        minWidth: 160
      },
      {
        field: 'housesData2Manager',
        title: '存档管理人',
        minWidth: 160
      },
      {
        field: 'housesData1',
        title: '项目人员任职承诺书',
        minWidth: 160
      },
      {
        field: 'housesData1Manager',
        title: '存档管理人',
        minWidth: 160
      },
      {
        field: 'transactionCustomerSatisfaction',
        title: '成交客户满意度调查表',
        minWidth: 160
      },
      {
        field: 'transactionCustomerSatisfactionManager',
        title: '存档管理人',
        minWidth: 160
      },
      {
        field: 'partyProves',
        title: '业绩确认表',
        minWidth: 160
      },
      {
        field: 'partyProvesManager',
        title: '存档管理人',
        minWidth: 160
      },
      {
        field: 'commission',
        title: '请佣单/结佣单',
        minWidth: 160
      },
      {
        field: 'commissionManager',
        title: '存档管理人',
        minWidth: 160
      },
      {
        field: 'withdrawalAgreement',
        title: '撤场协议',
        minWidth: 160
      },
      {
        field: 'withdrawalAgreementManager',
        title: '存档管理人',
        minWidth: 160
      },
      {
        field: 'otherInstructions',
        title: '其他说明',
        minWidth: 160
      },
      {
        title: '操作',
        fixed: 'right',
        width: 100,
        align: 'center',
        cell: (item) => {
          let btn = []
          btn.push({
            title: '查看',
            event: 'detail'
          })
          return {
            btn
          }
        }
      }
    ]
  }
}

export default Column
